define(['jquery'], () => {
    class Search {
        constructor() {
            this.search()
        }
        // 完成搜索功能
        search() {
            this.$input = $('#wareName')
            this.$input.on('keyup', () => {
                var BaseUrl = 'https://jf.10086.cn/portal/ware/web/SearchWareAction?'
                var t = new Date().getTime()
                console.log(this.$input.val())
                var s = encodeURI(encodeURI(encodeURI(this.$input.val())))
                // console.log(s)

                
                 $.getJSON(BaseUrl, {wt:'json', limit:10, q:s}, function (resp) {
                     console.log(resp)
                 })
                // TODOS：jsonp接口
            })
        }
    }
    return new Search()
});